use std::env::args;
use std::io::Write;

fn main() {
    let teacher:Teacher = Teacher { name: "".to_string(), students: (["2".to_string()]) };
    let _teacher2 = teacher;
    println!("{:?}",_teacher2);
    let _level3  = book::Name("sds".to_string());
    println!("{:?}",_level3);
    match _level3 {
        book::Name(val)=>{
            println!("{:?}",val);
        }
        _ => {}
    }
    // file_control();
    let file = std::fs::File::open("so.txt");
    println!("{:?}",file);
}
//结构体存放在堆上，所有权会发生转移
struct Student{
    name:String,
    Type:String
}
#[derive(Debug)]
struct Teacher{
    name:String,
    students:[String;1],
}
#[derive(Debug)]
enum book{
    Name(String),
    Price(i32),
}
fn io(){
    let result1 = std::io::stdout().write("ss".as_bytes()).unwrap();
    println!("\r");
    println!("{}",result1);
    let input_args = std::env::args();
    for arg in input_args{
        println!("{}",arg);
    }
}
fn file_control(){
    let currentdir = std::env::current_dir().unwrap();
    println!("{:?}",currentdir);
    let file = std::fs::File::open("so.txt");
    println!("{:?}",file);
}